package com.online.usermanagesystem.controller;

import com.online.usermanagesystem.entity.Account;
import com.online.usermanagesystem.service.AccountManageService;
import com.online.usermanagesystem.utils.accessrule.Rule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 企业信息管理控制器
 *
 * @author jhk
 * @create 2018-04-24 11:10
 */
@RestController
@RequestMapping(value = "/account")
public class AccountManageController {

    @Autowired
    private AccountManageService accountManageService;

    @RequestMapping(value = "/query", method = RequestMethod.GET)
    public Object query(Integer id) {
        return accountManageService.query(id);
    }

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public Object add(Account account) {
        return accountManageService.add(account);
    }

    @RequestMapping(value = "/modify", method = RequestMethod.POST)
    public Object modify(Account account) {
        return accountManageService.modify(account);
    }

    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public Object list(String keyword, Integer index, Integer count) {
        return accountManageService.list(keyword, index, count);
    }
}
